
const rpx = (num:number)=>{
    const adviceWidth = document.documentElement.clientWidth;
    return adviceWidth/750*num
}
type TFormatQueryResult = Record<string, string>;
const formatQuery = (query:string)=>{
    console.log(query);
    
    const queryItem:Array<any> = query.split('&')
    const result:TFormatQueryResult = {}
    queryItem.forEach(item=>{
        const myItem = item.split('=')
        const value = myItem.filter((item:string,index:number)=>index>0).join('=')
        const key = myItem[0]
        result[key] = value
    })
    console.log(result);
    
    return result
}
export {
    rpx,
    formatQuery
}